package consumer.ribbon.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

import java.util.logging.Logger;


/**
 * Create by Vic Xu on 2019/3/8
 */
@RestController
public class TraceController {

    private final Logger logger = Logger.getLogger(TraceController.class.getName());

    @Autowired
    private RestTemplate restTemplate;

    @GetMapping("/trace-1")
    public String trace() {
        logger.info("===call trace-1===");
        return restTemplate.getForEntity("http://eureka-client/trace-2", String.class).getBody();
    }

}
